
{include file="common/head"}
  
<head>
	<title>{$sys['tdk1']}</title>
	<meta name="Keywords" content="{$sys['tdk2']}" />
	<meta name="Description" content="{$sys['tdk3']}" />
	<style>
		.row{margin: 0;}
		.section{background-color: #fff;padding:6px;margin: 10px 0;border:0 solid #0a0;}
		.section-title{color:#C63927;font-weight: bold;margin: 6px;font-size: 1.1rem;}
		.row div{padding: 0;}
		a{text-decoration: none;}
		.goods{padding: 0;display: flex;justify-content:flex-start;flex-wrap: wrap;}
		.flex_item{width:16%;aspect-ratio: 1/1;height: auto; margin:1% 2%;position: relative;cursor: pointer;}

		.flex_item2{margin-bottom:2px;cursor: pointer;}
		.box{border-radius: 16px;border:1px solid #ddd;overflow: hidden;}
		.text{border:0px solid #ccc;padding: 0 4px;}
		.box:hover,.text:hover{border-color:#00f;}
		.tag{text-align: center;}
		.bar{width:100%;border:1px solid #ccc;height:120px;cursor: pointer;auto;margin-bottom: 2%;}
		#bottom {text-align: center;background:#fff;}
	</style>

</head>

<body >
		


	<div class="container-x" style="max-width: 1000px;margin:0 auto;">
	<!-- 内容 -->	


	<div id="content" >
		<!-- shop list -->
<!-- 		<div class="section" style="border: 0">
			<div class="row">
				<div class="col-3 fs-4" style="font-weight: bold;">
					{$sys.company_name}
				</div>

				<div class="col fs-4" style="text-align: right;">
					{if !$user}
					<a href='/admin' >登录</a>&nbsp;
					<a href='/user/register' >注册</a>				
					{else}
					【{$user['name']}】<a href="/admin">我的后台</a>
					{/if}
				</div>

			</div>
		</div> -->

		<!-- <div class="section-title">icon type</div> -->
		<div class="section">

			<div class="goods" >
				{foreach $ads as $kv}
					{if $kv['cat_id']==3}
					<div class="flex_item" g_id="{$kv['id']}" link="{$kv['link_url']}" uid="{$kv['user_id']}" show='{$kv["show"]}'>
						{if $kv['show']}
							<div class='box' style="width:100%;aspect-ratio: 1/1;" >
								<img src="{$kv['img2']}" style="width:100%;aspect-ratio: 1/1;" />
							</div>
							<div class='text-center'>
								{$kv['text']}
							</div>
						{else}
							<div class='box' style="width:100%;aspect-ratio: 1/1;">
								<img src="/upload/zz2.jpg" style="width:100%;aspect-ratio: 1/1;" />
							</div>
							<div class='text-center'>{$kv['name']}</div>
						{/if}
					</div>
					{/if}
				{/foreach}
			</div>
		</div>


			<!-- <div class="section-title">text ads</div> -->
		<div class="section">
			<div class="goods" >
				{foreach $ads as $kv}
					{if $kv['cat_id']==4}
					<div class="flex_item2" g_id="{$kv['id']}" link="{$kv['link_url']}" uid="{$kv['user_id']}" show='{$kv["show"]}' >
						<div class="text" style="">
						{if $kv['user_id']}
							{if $kv['hot']}
								<span class="bi-lightning-charge"></span>
								<span style='color:#00d;font-weight:bold;'>{$kv['text']}</span>
							{else}
								{$kv['text']}
							{/if}
							
						{else}
							招租{$kv['name']}
						{/if}
						</div>
					</div>
					{/if}
				{/foreach}
			</div>
		</div>


		<!-- <div class="section-title">bar</div> -->
		<div class="section">
			{foreach $ads as $kv}
				{if $kv['cat_id']==5}
				<div class="bar"  g_id="{$kv['id']}" link="{$kv['link_url']}" uid="{$kv['user_id']}" show='{$kv["show"]}'>
					{if $kv['user_id']}
						<img src="{$kv['img1']}" style="width:100%;height: 100%;" />
					{else}
						<img src="/upload/zz.jpg" style="width:100%;height: 100%;" />
					{/if}
				</div>
				{/if}
			{/foreach}
		</div>

	
<!-- 		<div class="section" style="margin-bottom: 50px;">
			{$sys.about_msg | raw}
		</div> -->

		<div  style="height:50px;"></div>
			
	</div>

	<div id="mask"></div>
	
	<input type="hidden" value="{$sys.msg}" id="show_msg" />

	<div style="height: 60px;"></div>
	<div id="bottom">
		<c class="text-info">{$sys.copy_right} </c> &nbsp;&nbsp;
		<a href="https://beian.miit.gov.cn/">{$sys.beian}</a> &nbsp;&nbsp;
		<a href="tencent://message/?uin=123456&Site=&Menu=yes">{$sys.company_name} <span class="bi-tencent-qq fs-3"></span>{$sys.qq}</a> 
	</div>


<script type="text/javascript">
	$(document).ready(function(){
		var msg=$("#show_msg").val().trim();

    $(".flex_item,.flex_item2,.bar").on('click',function(){
    	var g_id= $(this).attr('g_id');
    	var link =$(this).attr('link');
    	var uid=$(this).attr('uid');
    	var show=$(this).attr('show');

    	if(!uid){
				layer.open({title:'',content:'请QQ联系管理员',closeBtn: 0,shadeClose:1, });
    		return;
    	}
    	if(!show) {
				layer.open({title:'',content:'请QQ联系管理员',closeBtn: 0,shadeClose:1, });
    		return;
    	}
    	$.post('/goods/click',{gid:g_id},function(res){
					if (res.code == 1) {
						if(!link){
							window.open('/goods/detail/id/'+g_id,'_self');
						}
						window.open(link,'_blank');
					} else {
						layer.open({ content: res.msg });
					}
    	})

    })

		$("#mask").on('click',function(){
			$(this).hide();
		})

	});
</script>
</body>
</html>